#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=2e3+10,MOD=10;
int n,m,w[MAXN],f[MAXN],g[MAXN];
int main()
{
	n=read();m=read();
	f[0]=1;
	for(int i=1;i<=n;++i)
	{
		w[i]=read();
		for(int j=m;j>=w[i];--j)(f[j]+=f[j-w[i]])%=MOD;
	}
	for(int i=1;i<=n;++i)
	{
		memcpy(g,f,sizeof(f));
		for(int j=w[i];j<=m;++j)g[j]=(f[j]-g[j-w[i]]+MOD)%MOD;
		for(int j=1;j<=m;++j)printf("%d",g[j]);
		puts("");
	}
	return 0;
}
